#pragma once

#define PRS 6	//param size
class Chro2
{
public:
	Chro2();
	~Chro2();
	__int16 param[PRS];
	__int16 value;
	Chro2 operator=(Chro2 ch0);
	void Print();
};
class CInnerGA
{
public:
	CInnerGA(void);
	CInnerGA(CNodeTable*);
	~CInnerGA(void);

	
	int GetValue(Chro2*);
	int Run();
	void CreatePop(int opt);
	void select(Chro2*,Chro2*);
	void xover(Chro2*,Chro2*);
	void mutation(Chro2*);
	void replace(Chro2*);
	void saveGen(Chro2*);
	void QuickSort(int low,int high,int bound);
	void UpdateValue();
	void Init();
	void CheckTrend(Chro2* ch0);
	void ShowFD();

public:
	CNodeTable* nt;
	Chro2* pop;
	int nPop;
	Chro2* genPop;
	int nGenPop;
	int nValueTest;

	Chro2 temp[2];

	float mutRate;
	int eachGen;
	int totGen;
	int popSize;
	int genPopSize;
	int maxRange;

	int bestCnt;
	int bestCntForStop;

	int maxValueTest;
	CRepair rp;

	int farsee;
	int farseeGap;

	double threshold;

	Chro feasibleData[8];
	int fdCnt;
};

